package dao.impl;

import dao.AreaTop3Dao;
import domain.AggrStat;
import domain.AreaTop3;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import util.JDBCUtils;

import java.util.List;

public class AreaTop3DaoImpl implements AreaTop3Dao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<AreaTop3> SelectVisit() {
        String sql = "SELECT area,productid,clickCount FROM area_top3_product";
        List<AreaTop3> query = template.query(sql, new BeanPropertyRowMapper<AreaTop3>(AreaTop3.class));
        return query;
    }
}
